//
//  CantripOViewNode.h
//  CantripSDK
//
//  Created by James Callender on Mon Jul 21 2003.
//  Copyright (c) 2003 James Callender. All rights reserved.
//

#import <Foundation/Foundation.h>


@interface CantripOViewNode : NSObject 
{
@private
    CantripOViewNode *parent;
    NSMutableArray *children;
    id nodeValue;
}

- (void)setParent:(CantripOViewNode *)p;
- (CantripOViewNode *)parent;

- (void)insertChild:(CantripOViewNode *)child atIndex:(int)index;
- (void)insertChildren:(NSArray*)kids atIndex:(int)index;
- (void)removeChild:(CantripOViewNode *)child;
- (int)indexOfChild:(CantripOViewNode *)child;

- (int)numberOfChildren;
- (NSArray *)children;
- (CantripOViewNode *)firstChild;
- (CantripOViewNode *)lastChild;
- (CantripOViewNode *)childAtIndex:(int)n;

- (BOOL)isDescendantOfNode:(CantripOViewNode *)node;
- (BOOL)isDescendantOfNodeInArray:(NSArray*)nodes;

- (id)nodeValue;
- (void)setNodeValue:(id)value;

@end
